<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!--提示框-->
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta http-equiv="X-UA-Compatible" content="ie=edge">
	    <link rel="stylesheet" href="static/css/common.css">
	    <link rel="stylesheet" href="static/css/bootstrap.css">
	    <link rel="stylesheet" href="static/css/font-awesome-4.7.css">
	    <link rel="stylesheet" href="static/css/hzxx.css">
	    <script src="static/js/jquery-1.11.3.js"></script>
	    <script src="static/js/bootstrap.js"></script>
	    <script src="static/laydate/laydate.js"></script>
	</head>
<body>
		<div class="container-fluid" id="zhongxin">
        <div class="row">
            <!-- 患者主要信息展示页面 -->
            <div class="col-sm-12 col-md-12 col-lg-12 main">
                <form action="feedback/add.do" name="form" id="form"  method="post">     
                <input name="hzid" id="hzid" type="hidden">                                                    
                    <!-- 患者姓名 -->
                    <div class="r4">
                        <div class="col-sm-2 col-md-2 col-lg-2 lf left ">
                        	<i>*</i>
                            <span>患者姓名:</span>
                        </div>
                        <div class="col-sm-10 col-md-10 col-lg-10 lf right">
                            <input type="text" class="worker" id="hzxm" name="hzxm" placeholder="请输入患者姓名">
                        </div>
                    </div> 
                    <!-- 患者电话 -->
                    <div class="r5">
                        <div class="col-sm-2 col-md-2 col-lg-2 lf left ">
                         	<i>*</i>
                            <span>患者电话:</span>
                        </div>
                        <div class="col-sm-10 col-md-10 col-lg-10 lf right">
                            <input type="text" class="consignee" id="fkdh" name="fkdh" placeholder="请输入患者电话">
                        </div>
                    </div>   
                    <!-- 回访人姓名-->
                    <div class="r6">
                        <div class="col-sm-2 col-md-2 col-lg-2 lf left ">
                        	<i>*</i>
                            <span>回访人姓名:</span>
                        </div>
                        <div class="col-sm-10 col-md-10 col-lg-10 lf right">
                            <input type="text" class="consignee" id="hfrxm" name="hfrxm" placeholder="请输入回访人姓名">
                        </div>
                    </div>
                   	<div class="r6">
                        <div class="col-sm-2 col-md-2 col-lg-2 lf left ">
                        	<i>*</i>
                            <span>回访时间:</span>
                        </div>
                        <div class="col-sm-10 col-md-10 col-lg-10 lf right" style="height: 20px;" >
                           <input type="text" class="demo-input consignee" placeholder="请选择回访时间" id="hfsj" name="hfsj" readonly="readonly"  style="width:22%;">
                        </div>
                    </div>
                    <div class="r7">
                        <div class="col-sm-2 col-md-2 col-lg-2 lf left ">
                        	<i>*</i>
                            <span>反馈内容:</span>
                        </div>
                        <div class="col-sm-10 col-md-10 col-lg-10 lf right">
                            <textarea name="fknr" id="fknr" cols="30" rows="12" placeholder="请输入反馈内容" class="textarea"></textarea>
                        </div>
                    </div>
                    <div class="bottom col-sm-offset-5 col-sm-2 col-md-offset-5 col-md-2 col-lg-offset-5 col-lg-2">
                        <a class="btn btn-success" style="width:100%;" onclick="save();">提交</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green"></h4></div>

	
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		
		<script type="text/javascript">
		
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.date-picker').datepicker();
			
		});		
		
		</script>
<script type="text/javascript">
		
top.hangge();
//保存
function save(){		
	if($("#hzxm").val()==""){
		$("#hzxm").focus();
		return false;
	}
	if($("#fkdh").val()==""){
		$("#fkdh").focus();
		return false;
	}
	if($("#hfrxm").val()==""){
		$("#hfrxm").focus();
		return false;
	}
	if($("#hfsj").val()==""){
		$("#hfsj").focus();
		return false;
	}
	if($("#fknr").val()==""){
		$("#fknr").focus();
		return false;
	}
	hasU();
	//$("#form").submit();
	//$("#zhongxin").hide();
	//$("#zhongxin2").show(); 	
}

		
//判断患者和电话是否存在
function hasU(){
	var hzxm = $("#hzxm").val();
	var hzdh = $("#fkdh").val();
	$.ajax({
		type: "POST",
		url: '<%=basePath%>feedback/hasU.do',
    	data: {hzxm:hzxm,hzdh:hzdh},
		dataType:'json',
		cache: false,
		success: function(data){
			 if("success" == data.result){
				$("#form").submit();
				$("#zhongxin").hide();
				$("#zhongxin2").show();
			 }else{
				alert("患者姓名或电话不正确，请重新输入！");
				$("#hzxm").focus();
			 }
		}
	});
}

//执行一个laydate实例
laydate.render({
  elem: '#hfsj',
  type: 'datetime'//指定元素
});
</script>
	
</body>
</html>